import { Router } from 'express';
import productController from '../controllers/productController';

const router = Router();

// 商品管理路由
router.post('/', productController.createProduct);
router.get('/', productController.getProductList);
router.get('/stats', productController.getProductStats);
router.get('/:id', productController.getProductDetail);
router.put('/:id', productController.updateProduct);
router.delete('/:id', productController.deleteProduct);
router.post('/batch-delete', productController.batchDeleteProducts);
router.patch('/:id/status', productController.updateProductStatus);

// SKU管理路由
router.get('/:id/skus', productController.getProductSkus);
router.post('/:id/skus', productController.createProductSku);
router.put('/:id/skus/:skuId', productController.updateProductSku);
router.delete('/:id/skus/:skuId', productController.deleteProductSku);

export default router;